<%@ page language="java" contentType="text/html; charset=utf-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html>
<head>
    <title>我的订单</title>
    <meta charset="UTF-8">
    <link rel="stylesheet" href=/pharmacy/bootstrap/orderCss/iconfont.css>
    <link rel="stylesheet" href="/pharmacy/bootstrap/orderCss/global.css">
    <link rel="stylesheet" href="/pharmacy/bootstrap/orderCss/bootstrap.min.css">
    <link rel="stylesheet" href="/pharmacy/bootstrap/orderCss/bootstrap-theme.min.css">
    <link rel="stylesheet" href="/pharmacy/bootstrap/orderCss/swiper.min.css">
    <link rel="stylesheet" href="/pharmacy/bootstrap/orderCss/styles.css">
    <script src="/pharmacy/bootstrap/orderJs/jquery.min.js" charset="UTF-8"></script>
    <script src="/pharmacy/bootstrap/orderJs/bootstrap.min.js" charset="UTF-8"></script>
    <script src="/pharmacy/bootstrap/orderJs/swiper.min.js" charset="UTF-8"></script>
    <script src="/pharmacy/bootstrap/orderJs/global.js" charset="UTF-8"></script>
    <script src="/pharmacy/bootstrap/orderJs/alert.min.js" charset="UTF-8"></script>
    <script src="/pharmacy/bootstrap/orderJs/layer.js" charset="UTF-8"></script>

</head>
<body>

<div class="container-fluid" style="background-color: #f1f1f1">
    <jsp:include page="header.jsp"/>
</div>

<div class="content clearfix bgf5">
    <section class="user-center inner clearfix">


        <div class="pull-right">
            <div class="user-content__box clearfix bgf">
                <div class="title">我的订单</div>
                <div class="order-list__box bgf">
                    <div class="order-panel">
                        <ul class="nav user-nav__title" role="tablist">
                            <li class="nav-item active"><a href="order">所有订单</a></li>


                        </ul>

                        <div class="tab-content">
                            <div role="tabpanel" class="tab-pane fade in active" id="all">
                                <table class="table text-center">
                                    <tbody>
                                    <c:if test="${orderVOList==null}">
                                        <tr class="order-empty">
                                            <td colspan="6">
                                                <div class="empty-msg">最近没有任何订单，家里好像缺了点什么！<br><a href="index">要不瞧瞧去？</a>
                                                </div>
                                            </td>
                                        </tr>
                                    </c:if>
                                    <c:if test="${orderVOList!=null}">
                                        <tr>
                                            <th width="550">商品信息</th>
                                            <th width="120">订单金额</th>
                                            <th width="120">交易状态</th>
                                            <th width="120">交易操作</th>
                                        </tr>
                                        <c:forEach var="order" items="${orderVOList}">

                                            <tr class="order-item" id="tr319">
                                                <td>
                                                    <label>
                                                        <span>订单号: ${order.orderNo}</span>

                                                        <c:forEach var="ordergood" items="${order.object}">
                                                            <div class="card">
                                                                <div class="img"><a href="detail?goodid=${ordergood.goodNo}"><img src="/pharmacy/${ordergood.goodImage}" alt="" class="cover"></a></div>
                                                                <div class="name ep2"><a href="detail?goodid=${ordergood.goodNo}">${ordergood.goodName}</a></div>
                                                                <div class="format"></div>
                                                                <div class="favour">￥${ordergood.goodPrice}  x  ${ordergood.goodNum}件</div>
                                                            </div>
                                                            <br>

                                                        </c:forEach>

                                                        <span>下单时间: <fmt:formatDate value="${order.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/></span>
                                                    </label>
                                                </td>
                                                <td>￥${order.totalMoney}</td>
                                                <td class="state">
                                                    <c:if test="${order.orderStatus==-3}">已拒收</c:if>
                                                    <c:if test="${order.orderStatus==-2}">未付款</c:if>
                                                    <c:if test="${order.orderStatus==-1}">已取消</c:if>
                                                    <c:if test="${order.orderStatus==0}">待发货</c:if>
                                                    <c:if test="${order.orderStatus==1}">配送中</c:if>
                                                    <c:if test="${order.orderStatus==2}">已完成</c:if>

                                                </td>
                                                <td class="order">
                                                    <c:if test="${order.orderStatus==-2}">
                                                        <a href="http://localhost:8888/pharmacy/alipay/pay?out_trade_no=${order.orderNo}&price=${order.totalMoney}"

                                                           class="but but-primary">立即付款</a>
                                                    </c:if>
                                                </td>
                                            </tr>
                                        </c:forEach>
                                    </c:if>

                                    </tbody>
                                </table>

                            </div>
                        </div>
                    </div>
                </div>

            </div>
        </div>
    </section>
</div>

</body>
</html>